package com.sitanyun.merchant.guide.frament.presenter.impl;

import com.sitanyun.merchant.guide.frament.model.impl.UpdateNameAModelImpl;
import com.sitanyun.merchant.guide.frament.model.inter.IUpdateNameAModel;
import com.sitanyun.merchant.guide.frament.presenter.callback.CallBack;
import com.sitanyun.merchant.guide.frament.presenter.inter.IUpdateNameAPresenter;
import com.sitanyun.merchant.guide.frament.view.inter.IUpdateNameAView;

public class UpdateNameAPresenterImpl implements IUpdateNameAPresenter {
    private IUpdateNameAView mIUpdateNameAView;
    private IUpdateNameAModel mIUpdateNameAModel;

    public UpdateNameAPresenterImpl(IUpdateNameAView aIUpdateNameAView) {
        mIUpdateNameAView = aIUpdateNameAView;
        mIUpdateNameAModel = new UpdateNameAModelImpl();
    }

    @Override
    public void setuser(String staffName) {
        mIUpdateNameAModel.setuser(staffName, new CallBack() {
            @Override
            public void onSuccess(Object response) {
                mIUpdateNameAView.response(response,IUpdateNameAView.RESPONSE_ONE);
            }

            @Override
            public void onError(Throwable t) {
                mIUpdateNameAView.response(t,IUpdateNameAView.RESPONSE_TWO);
            }
        });
    }
}
